package com.shiliu.api;


import com.shiliu.model.entity.TestUser;
import com.shiliu.model.pojo.ResponseResult;
import io.swagger.annotations.*;

/**
 * @description: 测试用户控制类接口
 * @author: shiliu
 * @created: 2019/12/18 10:37
 * @version: v1.0.0
 */
@Api(tags = "测试User模块信息,包含增删改查")
public interface TestUserControllerApi {

    /**
     * 保存用户信息
     * @param user
     * @return
     */
    @ApiOperation(value = "添加用户",notes = "根据用户信息添加用户信息,传入Json格式")
    @ApiImplicitParam(name = "user",value = "用户信息实体",required = true,dataType = "TestUser")
    ResponseResult save(TestUser user);

    /**
     * 修改用户信息
     * @param user
     * @return
     */
    @ApiOperation(value = "修改用户信息",notes = "根据用户ID修改用户信息,传入Json格式")
    @ApiImplicitParam(name = "user",value = "用户信息实体",required = true,dataType = "TestUser")
    ResponseResult update(TestUser user);

    /**
     * 根据用户ID删除用户信息(暂时未启用逻辑删除)
     * @param id
     * @return
     */
    @ApiOperation(value = "根据用户ID删除用户信息",notes = "根据用户ID删除用户信息,ID为请求路径(path/{id})参数")
    @ApiImplicitParam(name = "id",value = "用户ID",required = true,dataType = "Long",paramType = "path")
    ResponseResult deleteById(Long id);

    /**
     * 根据用户ID查询用户信息
     * @param id
     * @return
     */
    @ApiOperation(value = "根据用户ID查询个人用户信息",notes = "根据用户ID查询个人用户信息,ID为请求路径(path/{id})参数")
    @ApiImplicitParam(name = "id",value = "用户ID",required = true,dataType = "Long",paramType = "path")
    ResponseResult queryById(Long id);

    /**
     * 分页条件查询
     * @param currentPage
     * @param size
     * @param user
     * @return
     */
    @ApiOperation(value = "分页查询用户信息数据",notes = "分页查询用户信息数据,并可以带查询参数,如果不传则为普通的分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码",required = true,dataType = "int",paramType = "path"),
            @ApiImplicitParam(name = "size",value = "每页显示记录数",required = true,dataType = "int",paramType = "path"),
            @ApiImplicitParam(name = "user",value = "条件查询实体",required = false,dataType = "TestUser")
    })
    ResponseResult queryByPage(Integer currentPage, Integer size, TestUser user);

    /**
     * 条件查询
     * @param user
     * @return
     */
    @ApiOperation(value = "条件查询用户信息数据",notes = "条件查询用户信息数据,并可以带查询参数,如果不传则为查询所有")
    @ApiImplicitParam(name = "user",value = "条件查询实体",required = false,dataType = "TestUser")
    ResponseResult query(TestUser user);
}
